﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;
using BingZi.HY.Core.SearchEngine.Configuration;

namespace BingZi.HY.Core.Entities.Center
{
	/// <summary>
	/// 商业资讯
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("商业资讯")]
	[BindTable("app_Articles", Description = "商业资讯", ConnName = "Center", DbType = DatabaseType.SqlServer)]
	public partial class app_Articles
	{
		#region 属性
		private Int32 _ArticleID =0;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ArticleID", "编号", "", "int", 10, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public Int32 ArticleID
		{
			get { return _ArticleID; }
			set { if (OnPropertyChange("ArticleID", value)) _ArticleID = value; }
		}

		private Int32 _UserID = 0;
		/// <summary>
		/// 所属用户
		/// </summary>
		[Description("所属用户")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "UserID", "所属用户", "", "int", 10, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public Int32 UserID
		{
			get { return _UserID; }
			set { if (OnPropertyChange("UserID", value)) _UserID = value; }
		}

		private Int32 _ShopCategoryID = 0;
		/// <summary>
		/// 店铺分类
		/// </summary>
		[Description("店铺分类")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(3, "ShopCategoryID", "店铺分类", "0", "int", 10, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public Int32 ShopCategoryID
		{
			get { return _ShopCategoryID; }
			set { if (OnPropertyChange("ShopCategoryID", value)) _ShopCategoryID = value; }
		}

		private Int32 _CategoryID =0;
		/// <summary>
		/// 文章文类
		/// </summary>
		[Description("文章文类")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(4, "CategoryID", "文章文类", "", "int", 10, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public Int32 CategoryID
		{
			get { return _CategoryID; }
			set { if (OnPropertyChange("CategoryID", value)) _CategoryID = value; }
		}

        private String _A_Title = "";
		/// <summary>
		/// 文章标题
		/// </summary>
		[Description("文章标题")]
		[DataObjectField(false, false, false, 128)]
		[BindColumn(5, "A_Title", "文章标题", "", "nvarchar(128)", 0, 0, true)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public String A_Title
		{
			get { return _A_Title; }
			set { if (OnPropertyChange("A_Title", value)) _A_Title = value; }
		}

        private String _A_Tags = "";
		/// <summary>
		/// 文章标签
		/// </summary>
		[Description("文章标签")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(6, "A_Tags", "文章标签", "", "nvarchar(50)", 0, 0, true)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public String A_Tags
		{
			get { return _A_Tags; }
			set { if (OnPropertyChange("A_Tags", value)) _A_Tags = value; }
		}

        private String _A_Photo = "";
		/// <summary>
		/// 文章图片
		/// </summary>
		[Description("文章图片")]
		[DataObjectField(false, false, true, 128)]
		[BindColumn(7, "A_Photo", "文章图片", "", "nvarchar(128)", 0, 0, true)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public String A_Photo
		{
			get { return _A_Photo; }
			set { if (OnPropertyChange("A_Photo", value)) _A_Photo = value; }
		}

        private String _A_Description = "";
		/// <summary>
		/// 文章内容
		/// </summary>
		[Description("文章内容")]
		[DataObjectField(false, false, false, 1073741823)]
		[BindColumn(8, "A_Description", "文章内容", "", "ntext", 0, 0, true)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public String A_Description
		{
			get { return _A_Description; }
			set { if (OnPropertyChange("A_Description", value)) _A_Description = value; }
		}

        private DateTime _A_StartTime = DateTime.Now;
		/// <summary>
		/// 发布时间
		/// </summary>
		[Description("发布时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(9, "A_StartTime", "发布时间", "", "datetime", 3, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public DateTime A_StartTime
		{
			get { return _A_StartTime; }
			set { if (OnPropertyChange("A_StartTime", value)) _A_StartTime = value; }
		}

        private DateTime _A_LastTime = DateTime.Now;
		/// <summary>
		/// 最后操作时间
		/// </summary>
		[Description("最后操作时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(10, "A_LastTime", "最后操作时间", "", "datetime", 3, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public DateTime A_LastTime
		{
			get { return _A_LastTime; }
			set { if (OnPropertyChange("A_LastTime", value)) _A_LastTime = value; }
		}

        private Int32 _A_LastUserID = 0;
		/// <summary>
		/// 最后操作用户
		/// </summary>
		[Description("最后操作用户")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(11, "A_LastUserID", "最后操作用户", "", "int", 10, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public Int32 A_LastUserID
		{
			get { return _A_LastUserID; }
			set { if (OnPropertyChange("A_LastUserID", value)) _A_LastUserID = value; }
		}

        private Int32 _A_Recommended = 0;
		/// <summary>
		/// 推荐1,正常0
		/// </summary>
		[Description("推荐1,正常0")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(12, "A_Recommended", "推荐1,正常0", "0", "tinyint", 3, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public Int32 A_Recommended
		{
			get { return _A_Recommended; }
			set { if (OnPropertyChange("A_Recommended", value)) _A_Recommended = value; }
		}

        private Int32 _A_State = 0;
		/// <summary>
		/// 状态(0:未审;1:正常;2:锁定;3:删除)
		/// </summary>
		[Description("状态(0:未审;1:正常;2:锁定;3:删除)")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(13, "A_State", "状态(0:未审;1:正常;2:锁定;3:删除)", "", "tinyint", 3, 0, false)]
        [SearchAttribute(Field_Store.YES, Field_Index.TOKENIZED, Field_TermVector.NO)]
		public Int32 A_State
		{
			get { return _A_State; }
			set { if (OnPropertyChange("A_State", value)) _A_State = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ArticleID" : return _ArticleID;
					case "UserID" : return _UserID;
					case "ShopCategoryID" : return _ShopCategoryID;
					case "CategoryID" : return _CategoryID;
					case "A_Title" : return _A_Title;
					case "A_Tags" : return _A_Tags;
					case "A_Photo" : return _A_Photo;
					case "A_Description" : return _A_Description;
					case "A_StartTime" : return _A_StartTime;
					case "A_LastTime" : return _A_LastTime;
					case "A_LastUserID" : return _A_LastUserID;
					case "A_Recommended" : return _A_Recommended;
					case "A_State" : return _A_State;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ArticleID" : _ArticleID = Convert.ToInt32(value); break;
					case "UserID" : _UserID = Convert.ToInt32(value); break;
					case "ShopCategoryID" : _ShopCategoryID = Convert.ToInt32(value); break;
					case "CategoryID" : _CategoryID = Convert.ToInt32(value); break;
					case "A_Title" : _A_Title = Convert.ToString(value); break;
					case "A_Tags" : _A_Tags = Convert.ToString(value); break;
					case "A_Photo" : _A_Photo = Convert.ToString(value); break;
					case "A_Description" : _A_Description = Convert.ToString(value); break;
					case "A_StartTime" : _A_StartTime = Convert.ToDateTime(value); break;
					case "A_LastTime" : _A_LastTime = Convert.ToDateTime(value); break;
					case "A_LastUserID" : _A_LastUserID = Convert.ToInt32(value); break;
					case "A_Recommended" : _A_Recommended = Convert.ToInt32(value); break;
					case "A_State" : _A_State = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得商业资讯字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ArticleID = "ArticleID";

			///<summary>
			/// 所属用户
			///</summary>
			public const String UserID = "UserID";

			///<summary>
			/// 店铺分类
			///</summary>
			public const String ShopCategoryID = "ShopCategoryID";

			///<summary>
			/// 文章文类
			///</summary>
			public const String CategoryID = "CategoryID";

			///<summary>
			/// 文章标题
			///</summary>
			public const String A_Title = "A_Title";

			///<summary>
			/// 文章标签
			///</summary>
			public const String A_Tags = "A_Tags";

			///<summary>
			/// 文章图片
			///</summary>
			public const String A_Photo = "A_Photo";

			///<summary>
			/// 文章内容
			///</summary>
			public const String A_Description = "A_Description";

			///<summary>
			/// 发布时间
			///</summary>
			public const String A_StartTime = "A_StartTime";

			///<summary>
			/// 最后操作时间
			///</summary>
			public const String A_LastTime = "A_LastTime";

			///<summary>
			/// 最后操作用户
			///</summary>
			public const String A_LastUserID = "A_LastUserID";

			///<summary>
			/// 推荐1,正常0
			///</summary>
			public const String A_Recommended = "A_Recommended";

			///<summary>
			/// 状态(0:未审;1:正常;2:锁定;3:删除)
			///</summary>
			public const String A_State = "A_State";
		}
		#endregion
	}
}